package com.vvlive.caibao.smartcity.base;

import android.util.Log;

import org.kymjs.kjframe.http.HttpCallBack;

import java.io.UnsupportedEncodingException;

/**
 * Created by zhj on 2015/9/9.
 */
public abstract class StringHttpCallBack extends HttpCallBack {

    public static final String GBK = "GBK";

    @Override
    public void onSuccess(byte[] t) {
        try {

            String gbk = new String(t, GBK);
            Log.i("Delete", "onSuccess: gbk = " + gbk);
            onSuccess(gbk);

        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void onFailure(int errorNo, String strMsg) {
        onError(errorNo, strMsg);
        Log.i("Delete", "onFailure: strMsg = " + strMsg);
    }

    public abstract void onSuccess(String data);

    public abstract void onError(int errNo, String str);
}
